package com.information.manage.maintenance.common.general;

import com.information.manage.maintenance.common.utils.ApplicationContextProvider;
import com.information.manage.maintenance.common.utils.MaintListGetter;
import com.information.manage.maintenance.mapper.*;

import java.util.HashMap;
import java.util.Map;

public class StaticMapperResources {
    // 定义一个静态的HashMap
    private static final Map<String, MaintListGetter> maintenanceMapperResources = new HashMap<>();

    // 静态代码块用于初始化HashMap
    static {
        maintenanceMapperResources.put("馈线上网点", ApplicationContextProvider.getBean(MaintKuixianMapper.class));
        maintenanceMapperResources.put("锚段关节", ApplicationContextProvider.getBean(MaintMaoduanMapper.class));
        maintenanceMapperResources.put("补偿装置", ApplicationContextProvider.getBean(MaintBuchangMapper.class));
        maintenanceMapperResources.put("线岔", ApplicationContextProvider.getBean(MaintXianchaMapper.class));
        maintenanceMapperResources.put("中锚", ApplicationContextProvider.getBean(MaintZhongmaoMapper.class));
        maintenanceMapperResources.put("补偿注油", ApplicationContextProvider.getBean(MaintBuchangMapper.class));
        maintenanceMapperResources.put("分相", ApplicationContextProvider.getBean(MaintFenxiangMapper.class));
        maintenanceMapperResources.put("分段", ApplicationContextProvider.getBean(MaintFenduanMapper.class));
        maintenanceMapperResources.put("隔离开关", ApplicationContextProvider.getBean(MaintGelikgMapper.class));
        maintenanceMapperResources.put("避雷器", ApplicationContextProvider.getBean(MaintBileiqiMapper.class));
        maintenanceMapperResources.put("高压电缆", ApplicationContextProvider.getBean(MaintGaoyadlMapper.class));
        maintenanceMapperResources.put("绝缘子", ApplicationContextProvider.getBean(MaintJueyzMapper.class));
        maintenanceMapperResources.put("全面检查", ApplicationContextProvider.getBean(MaintQuanmianjcMapper.class));
        // 可以继续添加更多的资源
    }

    // 获取资源的静态方法
    public static MaintListGetter getMapper(String key) {
        return maintenanceMapperResources.get(key);
    }
}
